using System;
using System.Windows.Forms;

namespace WillStott.MxAppToolbox
{
	/// <summary>
	/// Interface for standard Main Form with Toolbar and Statusbar support.After creating
	/// the application's main form, do the following:
	/// <list type="number">
    /// <item><description>Insert statement, using MxAppToolbox</description></item>
    /// <item><description>Set AccessibleName - MainWindow</description></item> 
	/// <item><description>Set AccessibleDescription - TestApp main window containing menu, toolbar and views</description></item>
	/// <item><description>Set Text as Application's name</description></item>
	/// <item><description>Set Application's icon</description></item>
	/// <item><description>Add Menu Strip, Status Bar Strip, Toolbar Strip from toolbox</description></item>
	/// <item><description>Add Menu items to Menu and use ampersand in text for mnemonic</description></item>
    /// <item><description>Add images (GIF, 16 x 16 or BMP) to Toolbar Strip + give a tooltip</description></item>
	/// <item><description>Set Toolbar and Statusbar AccessibleName, Descriptions</description></item>
    /// <item><description>Add Event handler for Toolbar Strip Button Click - toolStripMain_ItemClicked</description></item>
	/// <item><description>Set Tab order (View | Tab Order)</description></item>
	/// <item><description>Add Events for MainForm opening and closing and set them as public</description></item>
	/// <item><description>Add IMainForm interface to class definition and implement the other methods defined by this interface</description></item>
	/// </list>
	/// IMainForm works in conjunction with the application's class which is derived from Program in main.cs
	/// <seealso cref="Program"/> 
	/// </summary>
	public interface IMainForm
	{
		/// <summary>
		/// This method updates the user interface and is invoked whenever the main window's content 
		/// changes. For example; Form Ctor, View | Statusbar, View | Toolbar, Document change 
		/// <example>
		/// <code>
		/// public MainForm()
		///	{
		///		InitializeComponent();
		///		InitToolbar();
        ///     ToolbarOps.SetMenuItemImages(toolStripMain);
		///		UpdateFormUI();
		///	}
		/// public void UpdateFormUI()
		///	{
        ///		ToolbarOps.UpdateButtonState(toolStripMain);
		///		//resize windows in case toolbar or status window are toggled
		///	}
		/// </code>
		/// </example>
		/// </summary>
		void UpdateFormUI();

		/// <summary>
		/// Links the Toolbar to the Menu items. Invoked from the MainForm constructor.		
		/// <example>
		/// <code>
		/// public void InitToolbar()
		///	{
        ///		toolStripButtonToolsOptions.Tag = toolsOptionsToolStripMenuItem;
		///		...
		///	}
		///	</code>
		/// </example> 
		/// </summary>
		void InitToolbar();

		/// <summary>
		/// Event handler for user clicking a toolstrip button
		/// <example>
		/// <code>
        ///  public void toolStripMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
		///	{
		///		ToolbarOps.ButtonClick(e);
		///	}
		/// </code>
		/// </example>
		/// <seealso cref="ToolbarOps.ButtonClick"/> 
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
        void toolStripMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e);

		/// <summary>
		/// Event handler for Form opening
		/// <example>
		/// <code>
		///	public void MainForm_Load(object sender, System.EventArgs e)
		///	{
		///		TestWinApp.Instance.MainFormClosing = false;
		///	}
		/// </code>
		/// </example>
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		void MainForm_Load(object sender, System.EventArgs e);
		
		/// <summary>
		/// Event handler for Form closing
		/// <example>
		/// <code>
        ///	public void MainForm_Closing(object sender, System.Windows.Forms.FormClosingEventArgs e)
		///	{
		///		if ( TestWinApp.Instance.CloseAllDocuments(true) == false)
		///			e.Cancel = true;
		///	}
		/// </code>
		/// </example>
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		void MainForm_Closing(object sender, System.Windows.Forms.FormClosingEventArgs e);

	}
}
